#include "utils.h"

#include <string>
#include <fstream>

namespace utils {
  bool loadFile(const char *file, std::string *content) {
    if (!file || !content) return false;

    std::ifstream f;
    f.open(file, std::ios::binary);
    if (!f.is_open()) return false;
    content->assign(std::istreambuf_iterator<char>(f), std::istreambuf_iterator<char>());
    f.close();
    
    return true;
  }
}